#include"sock_init.h"
#include"work_thread.h"

int main()
{
    //创建套节字
    int socket=socket_init();
    if(socket==-1)
    {
        printf("ser create sockfd failed\n");
        exit(0);
    }
    
    while(1)
    { 
        //客户端连接服务器
        struct sockaddr_in caddr;
        int len=sizeof(caddr);
        
        int c=accept(socket,(struct sockaddr*)&caddr,&len);
        if(c<0)
        {
            continue;
        }
        printf("accept c=%d\n",c);

        //客户端连接成功，创建线程进行维护
        thread_start(c);

    }



}

